import isFunction from "lodash/isFunction";
import {
  Component,
  Vue
} from "vue-property-decorator";

@Component({})
export default class moduleHook extends Vue {
  mounted() {
    // const self = this;
    // console.log(this)
    // this.$Pubsub.on("onReachBottom", (e: any) => {
    //   if (self.isCurrent && isFunction(self.onReachBottom)) {
    //     self.onReachBottom(e);
    //   }
    // });

    // this.$Pubsub.on("onShow", (e: any) => {
    //   if (self.isCurrent && isFunction(self.onShow)) {
    //     self.onShow(e);
    //   }
    // });

    // this.$Pubsub.on("onPageScroll", (e: any) => {
    //   if (((self.isCurrent && self.name === "mall") || self.name === "home") && isFunction(self.onPageScroll)) {
    //     self.onPageScroll(e);
    //   }
    // });
  }

  destroyed() {
    this.$Pubsub.off("onReachBottom");
    this.$Pubsub.off("onShow");
    this.$Pubsub.off("onPageScroll");
    this.$Pubsub.off("onTap");
  }
};
